<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path=request.getContextPath()+"/"; %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <base href="<%=path%>" >
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="layui/css/font.css">
    <link rel="stylesheet" href="layui/css/xadmin.css">
    <script src="layui/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="layui/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th colspan="8" style="font-size: 16px;font-weight: bold;">
                                (一)工商登记信息
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr align="center">
                            <td  width="120">
                                公司名称
                            </td>
                            <td>
                                <input type="text"  name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).companyName}">
                            </td>
                            <td>
                                社会信用代码
                            </td>
                            <td>
                                <input type="text"  name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).socialCreditCode}">
                            </td>
                            <td>
                                成立日期
                            </td>
                            <td>
                                <input type="text"  name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).registerData}">
                            </td>
                            <td>
                                注册资本
                            </td>
                            <td>
                                <input type="text"  name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).registerCapital}万元">
                            </td>
                        </tr>
                        <tr align="center">

                            <td >住所</td>
                            <td colspan="3">
                                <input type="text" id name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).address}">

                            </td>
                            <td>
                                法定代表人
                            </td>
                            <td class="td-manage">

                                <input type="text" id name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).legalRepresentative}">

                            </td>
                            <td>
                                实缴金额
                            </td>
                            <td>
                                <input type="text" id name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${data.get(0).companyPaid}万元">
                            </td>
                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                              经营范围
                            </td>
                            <td colspan="7" >
                                <textarea  placeholder="请输入内容" name="desc" class="layui-textarea">${data.get(0).businessScope}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn" ><i class="layui-icon"></i>上传相关附件</button>&nbsp;&nbsp;(包含但不限于营业执照、ISO、高新技术企业等)
                            </td>
                        </tr>
                        <!--历史沿革-->
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                            (二)历史沿革
                            </td>
                        </tr>

                        <c:forEach items="${data3}" var="list3" varStatus="v">
                        <tr align="center">
                            <td>
                                <c:if test="${list3.changeNumber==0}">
                                    公司设立时股权结构
                                </c:if>
                                <c:if test="${list3.changeNumber!=0}" >
                                    公司第${list3.changeNumber}次股权变更后股权结构
                                </c:if>
                            </td>
                            <td colspan="6" align="left">
                                <table>

                                    <tr align="center">
                                        <td>
                                            序号
                                        </td>
                                        <td>
                                            出资方
                                        </td>
                                        <td>
                                            出资金额(万元)
                                        </td>
                                        <td>
                                            出资方式
                                        </td>
                                        <td>
                                            出资比例
                                        </td>
                                        <td>
                                            实缴金额
                                        </td>
                                    </tr>
                                    <c:forEach items="${data4.get(v.index)}" var="list4" varStatus="vs">
                                    <tr align="center">
                                        <td>
                                            ${vs.index+1}
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list4.investor}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list4.capitalContribution}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list4.capitalWay}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list4.capitalPercent}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required="" autocomplete="off" class="layui-input" value="${list4.paidInAmount}">
                                        </td>
                                    </tr>
                                    </c:forEach>
                                    <tr align="right">
                                        <td colspan="6" >
                                            <div>
                                                <button class="layui-btn">
                                                    <i class="layui-icon"></i>
                                                </button>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <button type="button" class="layui-btn" ><i class="layui-icon"></i>上传相关附件</button><br/>（包括但不限于审批文件、验资报告等）
                            </td>
                        </tr>
                        </c:forEach>

                        <tr>
                            <td>
                                第n次股权变更
                            </td>
                            <td colspan="6" align="center" style="border-right: none;">
                                <div>
                                    <button class="layui-btn">
                                        <i class="layui-icon"></i>
                                    </button>
                                </div>
                            </td>
                            <td style="border-left: none;">

                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (三)股东结构
                            </td>
                        </tr>
                        <tr align="center">
                            <td>
                                股东及出资情况
                            </td>
                            <td colspan="7" align="left">
                                <table align="center">
                                    <tr align="center">
                                        <td>
                                            序号
                                        </td>
                                        <td>
                                            出资方
                                        </td>
                                        <td>
                                            出资金额（万元）
                                        </td>
                                        <td>
                                            出资方式
                                        </td>
                                        <td>
                                            出资比例
                                        </td>
                                        <td>
                                            实缴金额
                                        </td>
                                    </tr>
                                    <c:choose>
                                        <c:when test="${fn:length(data2)==0 ||fn:length(data2)==''}" >
                                            <tr align="center">
                                                <td  colspan="6">暂无数据</td>
                                            </tr>
                                        </c:when>
                                    <c:otherwise >
                                    <c:forEach items="${data2}" var="list2" varStatus="vs">
                                    <tr align="center">

                                        <td>
                                            ${vs.index+1}
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list2.investor}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required="" autocomplete="off" class="layui-input" value="${list2.capitalContribution}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list2.capitalWay}">
                                        </td>
                                        <td>
                                            <input type="text" id name="email" required=""  autocomplete="off" class="layui-input" value="${list2.capitalContribution/10}%">
                                        </td>
                                        <td>
                                            ${list2.paidInAmount}
                                        </td>
                                    </tr>
                                    </c:forEach>
                                    </c:otherwise>
                                    </c:choose>

                                    <tr align="right">
                                        <td colspan="6">
                                            <div>
                                                <button class="layui-btn">
                                                    <i class="layui-icon"></i>
                                                </button>
                                            </div>
                                        </td>
                                       <!-- <td style="border-left: none;">

                                        </td>-->
                                    </tr>
                                </table>
                            </td>

                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (四)法人治理结构
                            </td>

                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                                股东会、董事会、监事会及经营层简介及设置情况
                            </td>
                            <td colspan="7">
                                   <textarea placeholder="请输入内容" name="desc" class="layui-textarea">${data.get(0).corporateStructure}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn" ><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (五)部门设置
                            </td>
                        </tr>
                        <tr align="center" >
                            <td rowspan="2">
                                部门设置及职能
                            </td>
                            <td  colspan="7">
                            <textarea placeholder="请输入内容" name="desc" class="layui-textarea">${data.get(0).departmentSet}</textarea>

                            </td>
                        </tr>
                        <tr align="center">
                            <td  colspan="7">
                                <div class="layui-upload" style="float: left;">

                                    <button type="button" class="layui-btn" ><i class="layui-icon"></i>上传相关附件</button>

                                </div>

                            </td>
                        </tr>
                        <tr >
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (六)分、子公司概况
                            </td>
                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                                分、子公司基本情况及经营范围、股权结构等
                            </td>
                            <td  colspan="7">
                               <textarea placeholder="请输入内容" name="desc" class="layui-textarea">${data.get(0).subsidiaryOverview}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn" ><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr align="center">
                            <td colspan="8">
                                    <button class="layui-btn" lay-filter="add" lay-submit="">保存</button>
                                <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate','form','upload','jquery'], function(){
        var laydate = layui.laydate;
        var  form = layui.form;
        var $ = layui.jquery;
        var upload = layui.upload;


        upload.render({
            elem: '#test3'
            ,url: 'https://httpbin.org/post' //改成您自己的上传接口
            ,accept: 'file' //普通文件
            ,done: function(res){
                layer.msg('上传成功');
                console.log(res);
            }
        });

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            ,url: 'https://httpbin.org/post' //改成您自己的上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
        // 监听全选
        form.on('checkbox(checkall)', function(data){

            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });


    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){

            if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

            }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
            }

        });
    }

    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {
        var ids = [];

        // 获取选中的id
        $('tbody input').each(function(index, el) {
            if($(this).prop('checked')){
                ids.push($(this).val())
            }
        });

        layer.confirm('确认要删除吗？'+ids.toString(),function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>
</html>